package org.metasketch.simulator.resources;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.metasketch.simulator.trace.Identified;

public abstract class ResourceBase extends Identified {

	Long id;

	String name;

	Map<String, Object> attributes = new HashMap<String, Object>();

	List<ResourceClass> classes = new ArrayList<ResourceClass>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Map<String, Object> getAttributes() {
		return attributes;
	}

	public void setAttributes(Map<String, Object> attributes) {
		this.attributes = attributes;
	}

	public List<ResourceClass> getClasses() {
		return classes;
	}

	public void setClasses(List<ResourceClass> classes) {
		this.classes = classes;
	}

	public void addClass(ResourceClass resourceClass) {
		if (!classes.contains(resourceClass))
			classes.add(resourceClass);

	}

}
